#include"map_view.h"
#include<graphics.h>
extern IMAGE white_wall, brown_wall;
void Map::update_tank_pos(int x, int y, int kind) {
	if (x < 0 || x > 26 || y < 0 || y > 25) {
		return;
	}
	m[x][y] = kind;
}

void Map::draw() {
	for (int i = 0; i < 26; i++) {
		for (int j = 0; j < 26; j++) {
			int x = j * 25;
			int y = i * 25;
			if (m[i][j] == 1) {
				putimage(x, y, &brown_wall);
			}
			else if (m[i][j] == 2 || m[i][j] == 3) {
				putimage(x, y, &white_wall);
			}
		}
	}
}